package java6681.lesson06;


class Person6681{
    private int age = 20;
    private String name = "新生";

    public void setAge(int stuAge){
        if (stuAge <= 150 && stuAge >= 0) {
            age = stuAge;
        }else {
            age = 0;
        }
    }
    public int getAge(){
        return age;
    }
    public void setName(String name){
        this.name = name;
    }
    public String getName(){
        return name;
    }

    public void say(String message){
        System.out.println(name +"("+age+")" + message);
    }
}

public class Person6681Demo {
    public static void main(String[] args) {
        Person6681 p1 = new Person6681();
        p1.setAge(21);
        p1.setName("张舒婷");
        p1.say("message");

        Person6681 p2 = new Person6681();
        p2.setName("张张");
        p2.setAge(160);
        p2.say("message");

        Person6681 p3 ;
        p3 = p2;
        p3.setAge(30);
        p3.say("message");
    }
}
